
# 开始菜单
def start_menu():
    from woniubook.user import reg
    from woniubook.user import login
    tip = '''
********************* 欢迎来到woniubook *********************
********************** 请选择以下操作 *********************
****************** 1.注册  2.登录  3.退出 *****************         
    '''
    print(tip)
    option = input("请输入你的选择：")
    if option == '1':
        reg()
    elif option == '2':
        login()
    else:
        exit("成功退出")

# 主菜单
def main_menu():
    from woniubook.book_operation import scan
    from woniubook.book_operation import cart
    from woniubook.book_operation import book_in
    from woniubook.book_operation import salenote
    tip = '''
***************************** 进入woniubook主菜单 ***************************
****************************** 请选择以下操作 *******************************
********************** 1. 浏览图书    2. 购物车   3. 图书入库  **************
******************* 4. 销售记录查询   5. 返回上级菜单   6. 退出  *************  
        '''
    print(tip)
    option = input("请输入你的选择：")
    if option == '1':
        scan()
    elif option == '2':
        cart()
    elif option == '3':
        book_in()
    elif option == '4':
        salenote()
    elif option == '5':
        start_menu()
    else:
        exit('谢谢，欢迎下次光临.')


if __name__ == '__main__':
    start_menu()
